<?php

define('LIB_PATH', '../library');
define('TESTCASE_PATH', dirname(__FILE__));
define('DS', DIRECTORY_SEPARATOR);
define('PS', PATH_SEPARATOR);

// establish include path
set_include_path(
    LIB_PATH . PS .
    TESTCASE_PATH . PS .
    get_include_path()
);

// require autoloader
require_once 'autoload.php';
// require_once 'Boss.php';

// require convenience functions
require_once 'convenience.php';
// require necessary simpletest files
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/reporter.php';
require_once 'simpletest/mock_objects.php';

// In order to get accurate times with this library, you must set your timezone
date_default_timezone_set('America/Los_Angeles');

// add tests cases to group and run the tests
$test = new TestSuite('Yahoo! BOSS API PHP Library Tests');
$test->add(new UnitTestCase_Boss_Api);
$test->add(new UnitTestCase_Boss_Request);

/**
 * If PHP is running in the CLI, use a simple text-based report. Otherwise, use
 * a fancy HTML report with the familiar green or red bar.
 */
if (TextReporter::inCli()) {
    exit ($test->run(new TextReporter()) ? 0 : 1);
}
$test->run(new HtmlReporter());